<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>服务单归档页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="resources/css/public.css" media="all"/>
</head>
<body>
<div class="layui-container" style="margin-top: 10px">
    <h1 class="layui-bg-green" style="text-align: center">服务单归档</h1>
    <div class="layui-row" style="margin-top: 10px">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md4" style="margin: 5px;border: #ececec">
            <label class="layui-form-label">服务单编号:</label>
            <input type="text" class=" servNo" style="border: none;padding: auto;margin: 10px" name="servNo"
                   lay-verify="required" readonly></input>
        </div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">类型:</label>
            <input type="text" class=" servType" name="servType" style="border: none;padding: auto;margin: 10px"
                   lay-verify="required" id="servType1"></input>
        </div>
        <div class="layui-col-md1">&nbsp;</div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2" >&nbsp;</div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">摘要:</label>
            <input type="text" class=" servTitle" style="border: none;padding: auto;margin: 10px" name="servTitle" lay-verify="required" readonly ></input></div>
        <div class="layui-col-md3" style="margin: 5px;">
            <label class="layui-form-label">客户姓名:</label>
            <input type="text" class=" servCustName" style="border: none;padding: auto;margin: 10px;width: 100px" name="servCustName" lay-verify="required" readonly ></input></div>
        <div> <input type="text" id="custManagerName" class="custManagerName" style="border: none;margin: 10px" readonly></input>

            <button class="layui-btn layui-btn layui-btn-xs" style="align-content: center" id="callBtn"><i class="layui-icon">&#xe612;</i></button>
            <input type="text" id="custTelephone" class="custTelephone" style="border: none;margin: 10px" readonly></input>

        </div>
        <div class="layui-col-md1" >&nbsp;</div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">状态:</label>
            <input type="text" id="servStatus1" class=" servStatus" style="border: none;padding: auto;margin: 10px"
                   name="servStatus" lay-verify="required" readonly></input></div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">创建人:</label>
            <input type="text" class=" servCreateBy" style="border: none;padding: auto;margin: 10px" name="servCreateBy"
                   lay-verify="required" readonly></div>
        <div class="layui-col-md1">&nbsp;</div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">创建时间:</label>
            <input type="text" class=" servCreateDate" style="border: none;padding: auto;margin: 10px"
                   name="servCreateDate" lay-verify="required" readonly></div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">被分配人:</label>
            <input type="text" class=" servDueTo" style="border: none;margin: 10px" name="servDueTo"
                   lay-verify="required" readonly></div>
        <div class="layui-col-md2">&nbsp;</div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">分配时间:</label>
            <input type="text" class=" servDueDate" style="border: none;padding: auto;margin: 10px" name="servDueDate"
                   lay-verify="required" readonly></div>
        <div class="layui-col-md4" style="margin: 5px">
            <label class="layui-form-label">当前处理人:</label>
            <input type="" id="reanNames" style="border: none;margin: 10px;color: #FF5722" th:value="${session.USER_SESSION.realname}"
                   readonly></input></div>
        <div class="layui-col-md2">&nbsp;</div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md8" style="margin: 5px">
            <label class="layui-form-label">服务需求:</label>
            <input type="hidden" class=" servRequest" id="servRequest" style="border: none;padding: auto;margin: 10px"
                   name="servRequest" lay-verify="required" readonly>
            <div style="margin: 10px">
                <span id="servRequesttext"></span>
            </div>
        </div>
        <div class="layui-col-md5" style="background-color: green;margin: 20px">
        </div>
    </div>
    <hr>
    <div class="layui-row">
        <div class="layui-col-md2">&nbsp;</div>
        <div class="layui-col-md8" style="margin: 5px">
            <label class="layui-form-label">处理意见：</label>
            <input type="hidden" class=" servDeal" style="border: none;padding: auto;margin: 10px" id="servDeal"
                   name="servDeal" lay-verify="required" readonly>
            <div style="margin: 10px">
                <span id="servDealText"></span>
            </div>
            <div style="text-align: center;margin: 10px">
            </div>
        </div>
        <div class="layui-col-md5" style="background-color: green;margin: 20px">
        </div>
    </div>
    <hr>



        <br>
        <div class="layui-row">
            <div class="layui-col-md2">&nbsp;</div>
            <div class="layui-col-md5">
                <div class="layui-form-item layui-form-text" style="margin-left: 20px">
                    <label class="layui-form-label">反馈结果：</label>
                    <input type="hidden" class=" servResult" style="border: none;padding: auto;margin: 10px" id="servResult"
                           name="servResult" lay-verify="required" readonly>
                    <div class="layui-input-block">
                        <span id="servResultText"></span>
                    </div>
                </div>
            </div>
            <div class="layui-col-md2 " style="margin-left: 20px">
                <input type="hidden" class=" servSatisfy" style="border: none;padding: auto;margin: 10px" id="servSatisfy"
                           name="servSatisfy" lay-verify="required" readonly>
                <label class="layui-form-label">评分：</label>
                <div class="layui-input-block">
                    <input type="text"  style="border: none;padding: auto;margin: 10px" id="servSatisfy2"
                           name="servSatisfy2" lay-verify="required" readonly>
                </div>


            </div>
            <div class="layui-col-md2 ">&nbsp;</div>
            <form id="dataFrm" class="layui-form">
                <input type="hidden" class=" servNo" style="border: none;padding: auto;margin: 10px" name="servNo" id="servNo"
                       lay-verify="required" readonly></input>
                <button class="layui-btn " style="margin-top: 10px" lay-submit="" lay-filter="serviceResult">归档</button>
            </form>
        </div>


</div>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script th:inline="none">
    layui.use(['form', 'layer', 'laydate', 'table', 'laytpl'], function () {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laydate = layui.laydate,
            laytpl = layui.laytpl,
            table = layui.table;
        var type = $("#servType1").val();
        var servStatus1 = $("#servStatus1").val();
        var serDealText = $("#servDeal").val();
        var requestText = $("#servRequest").val();//
        var resultText = $("#servResult").val();//
        var satisfy = $("#servSatisfy").val();
        $("#servRequesttext").text(requestText);
        $("#servDealText").text(serDealText);
        $("#servResultText").text(requestText);
        if(satisfy==1){
            $("#servSatisfy2").val("极差")
        } else if(satisfy==2){
            $("#servSatisfy2").val("差")
        }else if(satisfy==3){
            $("#servSatisfy2").val("一般")
        }else if(satisfy==4){
            $("#servSatisfy2").val("好")
        }else if(satisfy==5){
            $("#servSatisfy2").val("极好")
        }
        if (type == 1) {
            $("#servType1").val("投诉");
        } else if (type == 2) {
            $("#servType1").val("建议");
        } else if (type == 3) {
            $("#servType1").val("咨询");
        }
        if (servStatus1 == 1) {
            $("#servStatus1").val("新创建");
        } else if (servStatus1 == 2) {
            $("#servStatus1").val("已分配");
        } else if (servStatus1 == 3) {
            $("#servStatus1").val("已处理");
        } else if (servStatus1 == 4) {
            $("#servStatus1").val("已反馈");
        } else if (servStatus1 == 5) {
            $("#servStatus1").val("已归档");
        }
        form.on("submit(serviceResult)", function (data) {
            var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});

            //实际使用时的提交数据
            var params=$("#dataFrm").serialize();
            $.post("serviceFeedback.do",params,function (res) {
                console.log(res.code);
                if(res.code==1404){
                    top.layer.close(index);
                    top.layer.msg(res.msg);
                    var index1=parent.layer.getFrameIndex(window.name)
                    parent.layer.close(index1);
                    parent.location.reload();
                }else if(res.code=-1404){
                    layer.msg(res.msg);
                }
            },"json");
            return false;
        });
        var ms="打电话了,号码："+$("#custTelephone").val();
        $("#callBtn").click(function () {
            alert(ms);
        });


    });
</script>
</body>
</html>